﻿<UserControl x:Class="Microsoft.Research.Provenance.Controls.View.WorkflowInputView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="Auto" Width="Auto" MaxHeight="300" AutomationProperties.Name="AIDWorkFlowInputView">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../ProvenanceControlResources.xaml" ></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
            <BooleanToVisibilityConverter x:Key="boolToVisibilty"/>
            
            <!--Style for all TextBlock-->
            <Style TargetType="{x:Type TextBlock}" >
                <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text }"/>
                <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
                <Setter Property="MaxHeight" Value="15" />
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Expander Expanded="OnExpanded"  Header="Workflow Required Inputs" Style="{DynamicResource ExpanderStyle2}" FontSize="12" Margin="10,10,10,10" IsExpanded="{Binding Path=IsExpanded}" AutomationProperties.Name="ANameANameWorkFlowParametersExpander">
        <Border BorderBrush="#FFC8C8C8" BorderThickness="1,0,1,1" CornerRadius="0,0,5,5">
            <Border BorderBrush="#FFC8C8C8" BorderThickness="1,1,1,1" CornerRadius="5,5,5,5" Margin="5,5,5,5">
                <ScrollViewer HorizontalAlignment="Stretch" Margin="5,5,2,5" VerticalAlignment="Stretch" Grid.Row="0" VerticalScrollBarVisibility="Auto">
                    <Grid>
                        <Border BorderBrush="Transparent" Visibility="{Binding Converter={StaticResource boolToVisibilty}, Path=DoesNotContainItems}">
                            <TextBlock Text="No workflow required input(s) available."/>
                        </Border>
                        <ListView VerticalAlignment="Stretch" Width="Auto" 
                                  Height="Auto" IsSynchronizedWithCurrentItem="True" BorderBrush="#FFCECECE" 
                                  Visibility="{Binding Converter={StaticResource boolToVisibilty}, Path=ContainItems}" 
                                  Margin="0,0,0,0" ItemsSource="{Binding Path=InputProperties}" 
                                  AutomationProperties.Name="ANameRequiredInputListView">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn  Width="150" DisplayMemberBinding="{Binding Path=Name}">
                                        <GridViewColumn.Header>
                                            <TextBlock Text="Parameter" FontWeight="Bold" AutomationProperties.Name="ANameInputParameter"/>
                                    </GridViewColumn.Header>
                                    </GridViewColumn>
                                    <GridViewColumn Width="200" DisplayMemberBinding="{Binding Path=Value}">
                                        <GridViewColumn.Header>
                                            <TextBlock Text="Value" FontWeight="Bold"></TextBlock>
                                        </GridViewColumn.Header>
                                    </GridViewColumn>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Grid>
                </ScrollViewer>
            </Border>
        </Border>
    </Expander>
</UserControl>
